

package drinkkiosk;

import drinkkiosk.cards.ConfirmationCard;
import drinkkiosk.cards.CustomCard;
import drinkkiosk.cards.ManagerCard;
import drinkkiosk.cards.SendCard;
import drinkkiosk.cards.SpecialsCard;
import drinkkiosk.cards.UnlockCard;
import drinkkiosk.cards.WelcomeCard;
import java.awt.CardLayout;
import javax.swing.JPanel;
/**CardPanel is a JPanel with a CardLayout that contains and manages the various
 * views or Cards presented to the Patron. JPanels added to this JPanel can be
 * switched to via Button presses or other events. When a Card is shown by the
 * CardPanel it obscures all JPanels providing a simple and focused user experience.
 * @author Charles Ritchea
 */
public class CardPanel extends JPanel{
	/** Creates new form CardPanel */
	public CardPanel() {
		setBackground(new java.awt.Color(255, 255, 255));
		setMaximumSize(new java.awt.Dimension(800, 555));
		setMinimumSize(new java.awt.Dimension(800, 555));
		setPreferredSize(new java.awt.Dimension(800, 555));
		initComponents();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        welcomeCard1 = new drinkkiosk.cards.WelcomeCard();
        specialsCard1 = new drinkkiosk.cards.SpecialsCard();
        customCard1 = new drinkkiosk.cards.CustomCard();
        sendCard1 = new drinkkiosk.cards.SendCard();
        managerCard1 = new drinkkiosk.cards.ManagerCard();
        unlockCard1 = new drinkkiosk.cards.UnlockCard();
        confirmationCard1 = new drinkkiosk.cards.ConfirmationCard();
        offlineCard1 = new drinkkiosk.cards.OfflineCard();

        setMinimumSize(new java.awt.Dimension(800, 600));
        setPreferredSize(new java.awt.Dimension(800, 600));
        setLayout(new java.awt.CardLayout());
        add(welcomeCard1, "welcome");
        add(specialsCard1, "specials");
        add(customCard1, "custom");
        add(sendCard1, "send");
        add(managerCard1, "manager");

        unlockCard1.setMinimumSize(new java.awt.Dimension(800, 550));
        unlockCard1.setPreferredSize(new java.awt.Dimension(800, 550));
        add(unlockCard1, "unlock");
        add(confirmationCard1, "confirmation");
        add(offlineCard1, "offline");
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private drinkkiosk.cards.ConfirmationCard confirmationCard1;
    private drinkkiosk.cards.CustomCard customCard1;
    private drinkkiosk.cards.ManagerCard managerCard1;
    private drinkkiosk.cards.OfflineCard offlineCard1;
    private drinkkiosk.cards.SendCard sendCard1;
    private drinkkiosk.cards.SpecialsCard specialsCard1;
    private drinkkiosk.cards.UnlockCard unlockCard1;
    private drinkkiosk.cards.WelcomeCard welcomeCard1;
    // End of variables declaration//GEN-END:variables

    /**
     * 
     * @return
     */
    public SpecialsCard getSpecialsCard() {
		return specialsCard1;
	}
    /**
     * 
     * @param card
     */
    public synchronized void showSynchronized(String card){
        CardLayout cardLayout = (CardLayout) getLayout();
        cardLayout.show(this, card);
    }
}